import 'package:flutter_vpn/flutter_vpn.dart';
import 'package:get/get.dart';

import 'index.dart';

class VpnController extends GetxController {
  VpnController();

  final state = VpnState();

  // tap
  void handleTap(int index) {
    Get.snackbar(
      "标题",
      "消息",
    );
  }

  /// 在 widget 内存中分配后立即调用。
  @override
  void onInit() {
    FlutterVpn.prepare();
    FlutterVpn.onStateChanged.listen((s) {
      state.state = s;
      update();
    });
    super.onInit();
  }
}
